<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/1/30
 * Time: 10:13
 */


//swoole支付tp  pathinfo  和访问后销毁记录修改方法
//修改路径 tp5\thinkphp\library\think\Request.php
///***/
// * 获取当前请求URL的pathinfo信息（含URL后缀）
// * @access public
// * @return string
// */
//public function pathinfo()
//{
//    // 让swoole支付tp pathinfo 模式访问
//    if (isset($_SERVER['PATH_INFO']) && $_SERVER['PATH_INFO']!='/') {
//        return ltrim($_SERVER['PATH_INFO'], '/');
//    }
//    //        if (is_null($this->pathinfo)) {
//    if (isset($_GET[$this->config['var_pathinfo']])) {
//        // 判断URL里面是否有兼容模式参数
//        $pathinfo = $_GET[$this->config['var_pathinfo']];
//        unset($_GET[$this->config['var_pathinfo']]);
//    } elseif ($this->isCli()) {
//        // CLI模式下 index.php module/controller/action/params/...
//        $pathinfo = isset($_SERVER['argv'][1]) ? $_SERVER['argv'][1] : '';
//    } elseif ('cli-server' == PHP_SAPI) {
//        $pathinfo = strpos($this->server('REQUEST_URI'), '?') ? strstr($this->server('REQUEST_URI'), '?', true) : $this->server('REQUEST_URI');
//    } elseif ($this->server('PATH_INFO')) {
//        $pathinfo = $this->server('PATH_INFO');
//    }
//
//    // 分析PATHINFO信息
//    if (!isset($pathinfo)) {
//        foreach ($this->config['pathinfo_fetch'] as $type) {
//            if ($this->server($type)) {
//                $pathinfo = (0 === strpos($this->server($type), $this->server('SCRIPT_NAME'))) ?
//                    substr($this->server($type), strlen($this->server('SCRIPT_NAME'))) : $this->server($type);
//                break;
//            }
//        }
//    }
//
//    $this->pathinfo = empty($pathinfo) || '/' == $pathinfo ? '' : ltrim($pathinfo, '/');
////        }
//
//    return $this->pathinfo;
//}
//
///**
// * 获取当前请求URL的pathinfo信息(不含URL后缀)
// * @access public
// * @return string
// */
//public function path()
//{
////        if (is_null($this->path)) {
//    $suffix   = $this->config['url_html_suffix'];
//    $pathinfo = $this->pathinfo();
//
//    if (false === $suffix) {
//        // 禁止伪静态访问
//        $this->path = $pathinfo;
//    } elseif ($suffix) {
//        // 去除正常的URL后缀
//        $this->path = preg_replace('/\.(' . ltrim($suffix, '.') . ')$/i', '', $pathinfo);
//    } else {
//        // 允许任何后缀访问
//        $this->path = preg_replace('/\.' . $this->ext() . '$/i', '', $pathinfo);
//    }
////        }
//
//    return $this->path;
//}